﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

/// <summary>
///YQXZ 的摘要说明
/// </summary>
public class YQXZ
{
	public YQXZ()
	{
		//
		//TODO: 在此处添加构造函数逻辑
		//
  }

  public static SqlDataReader GetXX(string sID)
  {
    string sSql = "select * from jcxx_yqxz where yqxzid=@0";
    SqlParameter[] cmdParams = { new SqlParameter("@0", SqlDbType.VarChar, 20) };
    cmdParams[0].Value = sID;
    SqlDataReader dr = DbHelperSQL.ExecuteReader(sSql, cmdParams);
    return dr;
  }

  public static DataSet GetDS()
  {
    string sSql = "select * from jcxx_yqxz order by xh";
    DataSet ds = DbHelperSQL.Query(sSql);
    return ds;
  }

  public static SqlDataReader GetYHYQXZ(string sID)
  {
    string sSql = "select a.yqxzid,a.yqxz,(case when b.khid is null then 'false' else 'true' end) qx from jcxx_yqxz a left join jcxx_khyqxz b on a.yqxzid=b.yqxzid and b.khid=@0";
    SqlParameter[] cmdParams = new SqlParameter[1] { new SqlParameter("@0", SqlDbType.VarChar, 20) };
    cmdParams[0].Value = sID;
    SqlDataReader dr = DbHelperSQL.ExecuteReader(sSql, cmdParams);
    return dr;
  }
}
